package czy.demo.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import java.util.Date;

/**
 * 实体类
 */
@Document(indexName = "spring-elasticsearch-demo",type = "person",replicas = 0,shards = 5)
public class Person {

    /* 这里的id有个问题，es的id是独立于文档之外的字段，为_id，所以最后保存的结果是有一个_id为es主键，还有一个叫做id的普通字段 */
    @Id
    private String id;
    private String name;
    private String description;
    private Integer age;
    private Date create;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getCreate() {
        return create;
    }

    public void setCreate(Date create) {
        this.create = create;
    }
}
